import request from "@/utiles/request";
//获取教师列表
export const getTeacherListAPI = (pageNo = 1, pageSize = 10, keyword = "") =>
  request.get(`/teacher/getTeacherList?pageNo=${pageNo}&pageSize=${pageSize}&keyword=${keyword}`);
//给教师分配班级
export const assignClassAPI = (data) => request.post('/teacher/assignClass',data)
//获取教师对应的班级
export const getTeacherAndClassAPI = (id)=>request.get(`/teacher/getTeaAndClass?id=${id}`)
//添加或者修改教师接口
export const AddOrUpdateTeacherAPI = (data)=>{
  if(data._id) {
    return request.put(`/teacher/updateTeacher?id=${data._id}`,data)
  }else {
    return request.post('/teacher/Add',data)
  }
}
//获取教师详情
export const getTeacherDetailAPI = (id)=>request.get(`/teacher/getTeacherDetail?id=${id}`)
//删除教师
export const deleteTeacherAPI = (id)=>request.delete(`/teacher/deleteTeacher?id=${id}`)